package com.ming.controller;

import com.ming.controller.utils.BaseClass;
import com.ming.pojo.Book;
import com.ming.service.iBookService;
import lombok.extern.slf4j.Slf4j;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.env.Environment;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

//日志用法
//继承+注解减少日志对象声明操作
@Slf4j
@RestController
@RequestMapping("/Books")
public class BookController3 extends BaseClass {
    @Value("${country}")
    private String country;

    //  封装全部Value
    @Autowired
    private Environment environment;

    @Autowired
    private iBookService iBookService;

    @GetMapping()
    public String getById() {
        System.out.println("spring");

        System.out.println(environment.getProperty("${tempDir}"));

        log.debug("aaaa");
        return "spring";
    }


}
